Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change CacheFile.LogMessages type to Ilist<AssetsLogMessage> #6132

Closed
wants to merge 2 commits into from

Conversation

Nigusu-Allehu
Copy link
Contributor

@Nigusu-Allehu Nigusu-Allehu commented Oct 31, 2024

Bug

Fixes: NuGet/Home#13898

Description

The IAssetsLogMessage interface was removed in favor of using the concrete AssetsLogMessage class directly in CacheFile.LogMessages because AssetsLogMessage is a Data Transfer Object (DTO) with no business logic. DTOs do not require interfaces since they serve solely as data carriers, and no need for polymorphism. This change simplifies serialization by removing the need for custom converters and reduces unnecessary abstraction.

This will be useful for the following PR: #6081

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@Nigusu-Allehu Nigusu-Allehu marked this pull request as ready for review October 31, 2024 18:28
@Nigusu-Allehu Nigusu-Allehu requested a review from a team as a code owner October 31, 2024 18:28
Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this again and based on this comment: https://github.com/NuGet/NuGet.Client/pull/6081/files#r1825078556, I'm not sure it's worth breaking an API here.

The casting is also adding allocations and I'm not sure that trade off is worth it.
Let's resolve the other conversation first though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify CacheFile.LogMessages by Removing Unnecessary IAssetsLogMessage Interface
2 participants